# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
  def logged_in_as_manager?
    logged_in? && current_user.manager?
  end
  
  def render_user(user)
    user.render
  end
  
  def form_block(&proc)
    concat '<table class="form_section">', proc.binding
    yield
    concat '</table>', proc.binding
  end

  def fbrow(id=nil, label=nil, &proc)
    concat '<tr><td>', proc.binding
    if label.nil?
      concat '&nbsp;', proc.binding
    else
      concat "<label for=\"#{id}\">#{label}</label>", proc.binding
    end
    concat '</td><td>', proc.binding
    concat '<td>', proc.binding
    yield
    concat '</td></tr>', proc.binding
  end
  

end
